package com.fhj.movie.activity;

import com.fhj.movie_fhj_01.R;
import com.fhj.movie_main.MainActivity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class HyyItemClick extends Activity implements OnClickListener {
	private ImageView back;
	private TextView title;
	private ImageView progress;
	private String biaoti, path;
	private WebView webView;
	private Animation loadAnimation;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_itemclick);
		back = (ImageView) this.findViewById(R.id.itemclick_imageView);
		title = (TextView) this.findViewById(R.id.itemclick_textView);
		progress = (ImageView) this.findViewById(R.id.itemclick_image);
		webView = (WebView) this.findViewById(R.id.itemclick_webview);
		loadAnimation = AnimationUtils.loadAnimation(this, R.anim.taste);
		LinearInterpolator lir = new LinearInterpolator();
		loadAnimation.setInterpolator(lir);
		
		Intent intent = getIntent();
		biaoti = intent.getStringExtra("title");
		path = intent.getStringExtra("clickUrl");
		title.setText(biaoti);
		MyWebViewClient client = new MyWebViewClient(HyyItemClick.this,
				progress,loadAnimation);

		webView.setWebViewClient(client);

		WebSettings settings = webView.getSettings();

		settings.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
		settings.setAllowFileAccess(true);
		settings.setJavaScriptEnabled(true);
		webView.loadUrl(path);
		back.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.itemclick_imageView:
			this.finish();
			break;

		default:
			break;
		}
	}

	public void setLoadingButtonSate(int i) {
		// TODO Auto-generated method stub

	}
}
